// ----------------------------------------------------------------------------
// markItUp!
// ----------------------------------------------------------------------------
// Copyright (C) 2011 Jay Salvat
// http://markitup.jaysalvat.com/
// ----------------------------------------------------------------------------
// Html tags
// http://en.wikipedia.org/wiki/html
// ----------------------------------------------------------------------------
// Basic set. Feel free to add more tags
// ----------------------------------------------------------------------------


/**
 * my set:
 * Ctrl+1~5: pre-html, pre-js, pre-css, pre-php, pre-sql
 * Ctrl+Q: Preview Button
 * Ctrl+P: <img /> Button
 * Ctrl+L: <a> Button
 * Ctrl+D: <del> Button
 * Ctrl+S: <div class="source-box"></div>
 * Ctrl+T: Switch of the mySettings.tagtTansferMeaning
 */


var mySettings = {
	onShiftEnter:  	{keepDefault:false, replaceWith:'<br />\n'},
	onCtrlEnter:  	{keepDefault:false, openWith:'\n<p>', closeWith:'</p>'},
	onTab:    		{keepDefault:false, replaceWith:'    '},
	tagTransferMeaning: false,
	tagTransfers: {
		'<': '<*',
		'>': '*>',
		' ': '&nbsp;'
	},
	markupSet:  [ 			
		{ name:'H*', className:'markitup_h1_btn', dropMenu: [
			{name:'H1', className:'markitup_h1_btn', openWith:'<h1>', closeWith:'</h1>' },
			{name:'H2', className:'markitup_h2_btn', openWith:'<h2>', closeWith:'</h2>' },
			{name:'H3', className:'markitup_h3_btn', openWith:'<h3>', closeWith:'</h3>' },
			{name:'H4', className:'markitup_h4_btn', openWith:'<h4>', closeWith:'</h4>' },
			{name:'H4', className:'markitup_h5_btn', openWith:'<h5>', closeWith:'</h5>' },
			{name:'H6', className:'markitup_h6_btn', openWith:'<h6>', closeWith:'</h6>' }
		  ]
		},
		{name:'Bold', key:'B', className: 'markitup_bold_btn', openWith:'(!(<strong>|!|<b>)!)', closeWith:'(!(</strong>|!|</b>)!)' },
		{name:'Italic', key:'I', className: 'markitup_italic_btn', openWith:'(!(<em>|!|<i>)!)', closeWith:'(!(</em>|!|</i>)!)'  },
		{name:'Stroke through', key:'D', className: 'markitup_del_btn', openWith:'<del>', closeWith:'</del>' },
		
		{separator:'---------------' },
		
		{name:'Bulleted List', className: 'markitup_nodeul_btn', openWith:'    <li>', closeWith:'</li>', multiline:true, openBlockWith:'<ul>\n', closeBlockWith:'\n</ul>'},
		{name:'Numeric List', className: 'markitup_numol_btn', openWith:'    <li>', closeWith:'</li>', multiline:true, openBlockWith:'<ol>\n', closeBlockWith:'\n</ol>'},
		
		{separator:'---------------' },
		
		//{name:'Picture', key:'P', replaceWith:'<img src="[![Source:!:http://]!]" alt="[![Alternative text]!]" />' },
		{name:'Picture', key:'P', className: 'markitup_img_btn', openWith:'<img src="[[a_rf]]', closeWith:'" width="" height="" />' },
		//{name:'Link', key:'L', openWith:'<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>', closeWith:'</a>', placeHolder:'Your text to link...' },
		{name:'Link', key:'L', className: 'markitup_link_btn', openWith:'<a href="">', closeWith:'</a>' },
		
		{separator:'---------------' },
		
		{name:'Clean', className:'markitup_clean_btn', replaceWith:function(markitup) { return markitup.selection.replace(/<(.*?)>/g, "") } },		
		{name:'Preview(Ctrl+Q)', key:'Q', className:'markitup_preview_btn',  call:'preview'},
	
		{separator:'---------------' },
		
		{ name:'Syntax Highlighter', className:'markitup_highlightsourcebox_btn', dropMenu: [
			{name:'Html (Ctrl+1)', key:'1', className:'', openWith:'<pre class="brush: html">', closeWith:'</pre>' },
			{name:'Js (Ctrl+1)', key:'2', className:'', openWith:'<pre class="brush: js">', closeWith:'</pre>' },
			{name:'Css (Ctrl+1)', key:'3', className:'', openWith:'<pre class="brush: css">', closeWith:'</pre>' },
			{name:'Php (Ctrl+1)', key:'4', className:'', openWith:'<pre class="brush: php">', closeWith:'</pre>' },
			{name:'Sql (Ctrl+1)', key:'5', className:'', openWith:'<pre class="brush: sql">', closeWith:'</pre>' }
		  ]
		},
		
		{name:'Quotes (Ctrl+`)', key:'`', className:'markitup_quotes_btn', openWith:'<blockquote>', closeWith:'</blockquote>' },
		
		{ name:"Set-TagTrans", key:'T', className:'markitup_tagtrans_btn',
		    beforeInsert:function() {
		        mySettings.tagTransferMeaning = !mySettings.tagTransferMeaning;
		    }
		}
		
	]
}
